﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{
    /// <summary>
    /// 模块实体
    /// </summary>
    [Serializable]
    public class Sys_Module : Entity
    {
        /// <summary>
        /// 模块实体
        /// </summary>
        public Sys_Module()
            : base("Sys_Module")
        {
            this._ID = Guid.NewGuid().ToString();
            this._IsDelete = false;
            this._CreateDate = ConvertHelper.GetNowDateTime();
        }

        #region Model
        private string _ID;
        private string _ModuleName;
        private string _ModuleDes;
        private string _ModuleID;
        private string _FatherID;
        private bool? _IsDelete;
        private int? _Sort;
        private string _LinkAddress;
        private string _CssCss;
        private DateTime? _CreateDate;
        private string _CreateUser;
        /// <summary>
        /// 
        /// </summary>
        public string ID
        {
            get { return _ID; }
            set
            {
                this.OnPropertyValueChange(_.ID, _ID, value);
                this._ID = value;
            }
        }
        /// <summary>
        /// 模块名称
        /// </summary>
        public string ModuleName
        {
            get { return _ModuleName; }
            set
            {
                this.OnPropertyValueChange(_.ModuleName, _ModuleName, value);
                this._ModuleName = value;
            }
        }
        /// <summary>
        /// 模块描述
        /// </summary>
        public string ModuleDes
        {
            get { return _ModuleDes; }
            set
            {
                this.OnPropertyValueChange(_.ModuleDes, _ModuleDes, value);
                this._ModuleDes = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ModuleID
        {
            get { return _ModuleID; }
            set
            {
                this.OnPropertyValueChange(_.ModuleID, _ModuleID, value);
                this._ModuleID = value;
            }
        }
        /// <summary>
        /// 上级模块
        /// </summary>
        public string FatherID
        {
            get { return _FatherID; }
            set
            {
                this.OnPropertyValueChange(_.FatherID, _FatherID, value);
                this._FatherID = value;
            }
        }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDelete
        {
            get { return _IsDelete; }
            set
            {
                this.OnPropertyValueChange(_.IsDelete, _IsDelete, value);
                this._IsDelete = value;
            }
        }
        /// <summary>
        /// 排序
        /// </summary>
        public int? Sort
        {
            get { return _Sort; }
            set
            {
                this.OnPropertyValueChange(_.Sort, _Sort, value);
                this._Sort = value;
            }
        }
        /// <summary>
        /// 连接地址
        /// </summary>
        public string LinkAddress
        {
            get { return _LinkAddress; }
            set
            {
                this.OnPropertyValueChange(_.LinkAddress, _LinkAddress, value);
                this._LinkAddress = value;
            }
        }
        /// <summary>
        /// 样式名称
        /// </summary>
        public string CssCss
        {
            get { return _CssCss; }
            set
            {
                this.OnPropertyValueChange(_.CssCss, _CssCss, value);
                this._CssCss = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? CreateDate
        {
            get { return _CreateDate; }
            set
            {
                this.OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                this._CreateDate = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CreateUser
        {
            get { return _CreateUser; }
            set
            {
                this.OnPropertyValueChange(_.CreateUser, _CreateUser, value);
                this._CreateUser = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.ID};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.ID,
				_.ModuleName,
				_.ModuleDes,
				_.ModuleID,
				_.FatherID,
				_.IsDelete,
				_.Sort,
				_.LinkAddress,
				_.CssCss,
				_.CreateDate,
				_.CreateUser};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._ID,
				this._ModuleName,
				this._ModuleDes,
				this._ModuleID,
				this._FatherID,
				this._IsDelete,
				this._Sort,
				this._LinkAddress,
				this._CssCss,
				this._CreateDate,
				this._CreateUser};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._ID = DataUtils.ConvertValue<string>(reader["ID"]);
            this._ModuleName = DataUtils.ConvertValue<string>(reader["ModuleName"]);
            this._ModuleDes = DataUtils.ConvertValue<string>(reader["ModuleDes"]);
            this._ModuleID = DataUtils.ConvertValue<string>(reader["ModuleID"]);
            this._FatherID = DataUtils.ConvertValue<string>(reader["FatherID"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(reader["IsDelete"]);
            this._Sort = DataUtils.ConvertValue<int?>(reader["Sort"]);
            this._LinkAddress = DataUtils.ConvertValue<string>(reader["LinkAddress"]);
            this._CssCss = DataUtils.ConvertValue<string>(reader["CssCss"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(reader["CreateUser"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._ID = DataUtils.ConvertValue<string>(row["ID"]);
            this._ModuleName = DataUtils.ConvertValue<string>(row["ModuleName"]);
            this._ModuleDes = DataUtils.ConvertValue<string>(row["ModuleDes"]);
            this._ModuleID = DataUtils.ConvertValue<string>(row["ModuleID"]);
            this._FatherID = DataUtils.ConvertValue<string>(row["FatherID"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(row["IsDelete"]);
            this._Sort = DataUtils.ConvertValue<int?>(row["Sort"]);
            this._LinkAddress = DataUtils.ConvertValue<string>(row["LinkAddress"]);
            this._CssCss = DataUtils.ConvertValue<string>(row["CssCss"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(row["CreateUser"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "Sys_Module");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field ID = new Field("ID", "Sys_Module", "ID");
            /// <summary>
            /// 模块名称
            /// </summary>
            public readonly static Field ModuleName = new Field("ModuleName", "Sys_Module", "模块名称");
            /// <summary>
            /// 模块描述
            /// </summary>
            public readonly static Field ModuleDes = new Field("ModuleDes", "Sys_Module", "模块描述");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field ModuleID = new Field("ModuleID", "Sys_Module", "ModuleID");
            /// <summary>
            /// 上级模块
            /// </summary>
            public readonly static Field FatherID = new Field("FatherID", "Sys_Module", "上级模块");
            /// <summary>
            /// 是否删除
            /// </summary>
            public readonly static Field IsDelete = new Field("IsDelete", "Sys_Module", "是否删除");
            /// <summary>
            /// 排序
            /// </summary>
            public readonly static Field Sort = new Field("Sort", "Sys_Module", "排序");
            /// <summary>
            /// 连接地址
            /// </summary>
            public readonly static Field LinkAddress = new Field("LinkAddress", "Sys_Module", "连接地址");
            /// <summary>
            /// 样式名称
            /// </summary>
            public readonly static Field CssCss = new Field("CssCss", "Sys_Module", "样式名称");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CreateDate = new Field("CreateDate", "Sys_Module", "CreateDate");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CreateUser = new Field("CreateUser", "Sys_Module", "CreateUser");
        }
        #endregion


    }
}


